package cn.xiaobai.core.domain;

import cn.xiaobai.enums.ToolConfigTypeEnum;
import com.fasterxml.jackson.databind.node.ObjectNode;

import java.util.List;

/**
 * todo 修改
 * @author jiangfei
 * @date 2019/11/16
 */
public class PluginConfig {

    /**
     * 配置项名
     */
    private String name;

    /**
     * 配置项code
     */
    private String code;

    /**  todo 修改: 让项目启动时去监听触发, 将加载好的类全部加到
     * 配置项类型
     */
    private ToolConfigTypeEnum type;

    /**
     * 配置项是否要判空
     */
    private Boolean checkEmpty;

    /**
     * 下拉框选项的选项值
     */
    private List<ObjectNode> options;

    public PluginConfig(String name, String code,
                        ToolConfigTypeEnum type,
                        Boolean checkEmpty) {
        this.name = name;
        this.code = code;
        this.type = type;
        this.checkEmpty = checkEmpty;
    }

    public PluginConfig(String name, String code,
                        ToolConfigTypeEnum type,
                        Boolean checkEmpty,
                        List<ObjectNode> options) {
        this.name = name;
        this.code = code;
        this.type = type;
        this.checkEmpty = checkEmpty;
        this.options = options;
    }
}
